const proxyObj = {};
// 后端项目配置的host和port
const targetURL = "http://localhost:8090";

// 跨域配置
proxyObj['/api'] = {
	ws: false,
	target: targetURL,    // 请求转发后的请求地址
	changeOrigin: true,
	pathRewrite: {
		'^/api': ''
	}
};


module.exports = {
	runtimeCompiler: true,
	configureWebpack: {
		resolve: {
			extensions: ['.js', '.vue', '.json', '.css'],
			alias: {
				'assets': '@/assets',
				'components': '@/components',
				'views': '@/views',
				'network': '@/network'
			}
		}
	},
	/* 后端服务代理配置 */
	devServer: {
		host: "localhost",
		port: 8080,
		proxy: proxyObj
	}
};
